<div id="comments">
<? echo $adminMenu->manage(); ?>
<h2><?php __('COMMENTS_ADMIN_TITLE');?></h2>
<? echo $html->link(__('COMMENTS_DELETE_ALL_SPAM',true),array('action'=>'delete_spam')); ?>
<? echo $form -> create(array('action'=>'delete_comments')); ?>
<table cellpadding="3" cellspacing="1" width="100%">
<tr>
	<td width="7%"></td>
	<td></td>
	<td width="10%"></td>
	<td width="10%"></td>
	<td width="10%"></td>
	<td width="10%"></td>
</tr>
<tr class="table_head">
	<td colspan="2" class="first-top">
		<? echo $pagination -> create(null,'comments'); ?>
	</td>
	<td colspan="5" class="last-top">
		<? __('SORT_BY'); ?>: <?php echo $paginator->sort(__('USERNAME',true),'user_name');?> <? echo $paginator->sort(__('SPAM',true),'antispam'); ?> <?php echo $paginator->sort(__('IP',true),'user_ip');?>
	</td>
</tr>
<tr>
	<th><? __('ACTION'); ?></th>
	<th><? __('TITLE'); ?></th>
	<th><? __('USERNAME'); ?></th>
	<th><? __('IP'); ?></th>
	<th><? __('SPAM'); ?></th>
	<th><? __('DELETE'); ?> <input type="checkbox" onclick="checkAll(this,'CommentDeleteCommentsForm')"/></th>
</tr>
		<?php
$i = 0;
foreach ($comments as $comment):
	$class = null;
	if ($i++ % 2 == 0) {
		$class = ' class="altrow"';
	}
?>
	<tr<?php echo $class;?>>
		<td>
			<? echo $html->link($html->image('edit.png',array('alt'=>__('EDIT', true))),array('action'=>'edit', $comment['Comment']['id']),array('title'=>__('EDIT',true)),null,false); ?>
			<? echo $html->link($html->image('eye.png',array('alt'=>__("PREVIEW",true))),"/articles/".$time->format("Y/m/d",$comment["Article"]["created"])."/".$comment["Article"]["seo_link"].'/#comment_'.$comment['Comment']['id'],array('title'=>__('PREVIEW',true),"target"=>"new"),null,false); ?> 
			<? echo $html->link($html->image('bin.png',array('alt'=>__('DELETE', true))), array('action'=>'delete', $comment['Comment']['id']),array('title'=>__('DELETE',true)), __('DELETE_ITEM', true).' #' . $comment['Comment']['title'],false); ?>
		</td>
		<td>
			<? echo $html->link($comment['Comment']['title'], array('action'=>'edit', $comment['Comment']['id'])); ?>
		</td>
		<td>
			<?php echo $comment['Comment']['user_name']?>
		</td>
		<td>
			<?php echo $comment['Comment']['user_ip']?>
		</td>
		<td>
			<?php echo ($comment['Comment']['antispam']!=null) ? __('YES') : __('NO')?>
		</td>
		<td  align="center">
			<input type="checkbox" name="data[CommentsDelete][]" value="<? echo $comment['Comment']['id']; ?>"/>
		</td>
	</tr>
<?php endforeach; ?>
<tr class="table_head">
	<td colspan="2" class="first-bottom">
		<? echo $pagination -> create(null,'comments'); ?>
	</td>
	<td colspan="4" class="last-bottom">
		<? __('SORT_BY'); ?>: <?php echo $paginator->sort(__('USERNAME',true),'user_name');?> <? echo $paginator->sort(__('SPAM',true),'antispam'); ?> <?php echo $paginator->sort(__('IP',true),'user_ip');?>
	</td>
</tr>
</table>
<div style="float: right; margin: 1em;"><? echo $form -> submit(__('DELETE',true)); ?></div>
</form>
</div>